package nicewarm.com.airbansearchanimation.adapter;

import android.content.Intent;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.ImageView;
import android.widget.RadioButton;
import android.widget.RadioGroup;

import com.bumptech.glide.Glide;
import com.bumptech.glide.load.engine.DiskCacheStrategy;
import com.chad.library.adapter.base.BaseQuickAdapter;
import com.chad.library.adapter.base.BaseViewHolder;

import java.util.List;

import nicewarm.com.airbansearchanimation.R;
import nicewarm.com.airbansearchanimation.model.AppListItem;

/**
 * Created by luoxf on 16-9-19.
 */
public class AppListAdapter extends BaseQuickAdapter<AppListItem, BaseViewHolder> {

    private String mSelectText;

    public AppListAdapter(List<AppListItem> data) {
        super(R.layout.item_app_info, data);
    }

    @Override
    protected void convert(BaseViewHolder baseViewHolder, final AppListItem appInfo) {
        baseViewHolder.setText(R.id.app_name, appInfo.getAppName());
        baseViewHolder.setText(R.id.app_size, appInfo.getAppSize());
        Glide.with(mContext)
                .load(appInfo.getImageUrl())
                .centerCrop()
                .diskCacheStrategy(DiskCacheStrategy.SOURCE)
                .crossFade(500)
                .into((ImageView) baseViewHolder.getView(R.id.app_icon));
    }

}
